<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('新增市政收入报表')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<style>
    input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }

    input[type="number"] {
        -moz-appearance: textfield;
    }

    .gray-bg {
        background-color: #FFFFFF;
    }

    form {
        white-space: nowrap;
    }

</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="dv">
    <form class="form-horizontal m" id="add" AUTOCOMPLETE="OFF">
        <input type="hidden" id="materialId" name="materialId">
        <div class="form-group">
            <div class="col-sm-12">
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label">采购日期 ：</label>
                    <div class="col-sm-8">
                        <input id="purchaseDate" name="purchaseDate" class="form-control" placeholder="请输入采购日期"
                               type="text" required>
                    </div>
                </div>
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label">采购数量：</label>
                    <div class="col-sm-8">
                        <input id="purchaseQuantity" name="purchaseQuantity" class="form-control" placeholder="请输入采购数量"
                               type="number" required>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: select2-js"/>

<script th:inline="javascript">
    var prefix = ctx + "manage";

    $(function () {
        /* 初始化 数据 */
        $("#materialId").val([[${materialId}]]);
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#purchaseDate',
                type: 'date'
            });
        });

    })

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#add").serializeArray();
            var index = location.href.split('index=');
            $.operate.save(prefix + "/addChildMater", data);
            parent.refreshSun(index[1]);
        }
    }

</script>
</body>
</html>